<html>
<head><meta charset="utf-8"><title>negative impls · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html">negative impls</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216876895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216876895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216876895">(Nov 16 2020 at 14:22)</a>:</h4>
<p>So I've been talking to <span class="user-mention" data-user-id="362503">@Yulia Startsev</span> about doing some follow-up work on negative impls. As a starting point, <span class="user-mention" data-user-id="216206">@lcnr</span>, we were discussing reviving <a href="https://github.com/rust-lang/rust/pull/74648/">https://github.com/rust-lang/rust/pull/74648/</a></p>



<a name="216876958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216876958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216876958">(Nov 16 2020 at 14:22)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span></p>



<a name="216877098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877098">(Nov 16 2020 at 14:24)</a>:</h4>
<p>So...</p>



<a name="216877145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877145">(Nov 16 2020 at 14:24)</a>:</h4>
<p>reviewing the PR...</p>



<a name="216877216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877216">(Nov 16 2020 at 14:24)</a>:</h4>
<p>the main idea of <em>this PR</em> was to basically prevent us from adding the kinds of negative impls that the current trait checker doesn't really handle (and which we may never want to support, that's debatable perhaps)</p>



<a name="216877258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877258">(Nov 16 2020 at 14:25)</a>:</h4>
<p>there is some debate about how negative impls + auto traits <em>ought</em> to interact</p>



<a name="216877290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877290">(Nov 16 2020 at 14:25)</a>:</h4>
<p>it seems like the biggest <em>problem</em> with the PR as implemented was diagnostics</p>



<a name="216877313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877313">(Nov 16 2020 at 14:25)</a>:</h4>
<p>I forget how much we talked <span class="user-mention" data-user-id="362503">@Yulia Startsev</span> about the goals of the PR?</p>



<a name="216877468"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877468" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877468">(Nov 16 2020 at 14:26)</a>:</h4>
<p>Let me echo back what I understood from our discussion..</p>



<a name="216877563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877563">(Nov 16 2020 at 14:27)</a>:</h4>
<p>The overall goal is to prevent conditional negative impls, as this is potentially a source of headaches and the problems that it solves can be solved almost entirely without it</p>



<a name="216877700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877700">(Nov 16 2020 at 14:28)</a>:</h4>
<p>This pr specifically rejects the ability to have optin builtin traits and negative impls overlap, and moves towards that overall goal</p>



<a name="216877703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877703">(Nov 16 2020 at 14:28)</a>:</h4>
<p>Yeah, we just want to sidestep the tricky situations for now. Either a negative impl applies to <em>all instances</em> of a type or none.</p>



<a name="216877763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877763">(Nov 16 2020 at 14:29)</a>:</h4>
<p>(Hmm, it occurs to me that we probably want to forbid negative impls for traits that have multiple input types too, to simplify our lives.)</p>



<a name="216877794"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877794" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877794">(Nov 16 2020 at 14:29)</a>:</h4>
<p>e.g., we wouldn't want to permit</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">A</span><span class="p">,</span><span class="w"> </span><span class="n">B</span><span class="o">&gt;</span><span class="w"> </span><span class="o">!</span><span class="n">Foo</span><span class="o">&lt;</span><span class="n">A</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">B</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="216877828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877828">(Nov 16 2020 at 14:29)</a>:</h4>
<p>we currently have no use for such things :)</p>



<a name="216877839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877839">(Nov 16 2020 at 14:29)</a>:</h4>
<p>(eventually, perhaps)</p>



<a name="216877951"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877951" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877951">(Nov 16 2020 at 14:30)</a>:</h4>
<p>Is there already a tracking issue for the overall goal?</p>



<a name="216877973"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877973" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877973">(Nov 16 2020 at 14:30)</a>:</h4>
<p>The one I have to go off right now is <a href="https://github.com/rust-lang/rust/issues/13231">https://github.com/rust-lang/rust/issues/13231</a></p>



<a name="216877977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216877977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216877977">(Nov 16 2020 at 14:30)</a>:</h4>
<p>I don't know, I was wondering that. We should create one.</p>



<a name="216878005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878005">(Nov 16 2020 at 14:30)</a>:</h4>
<p>Yeah, that's not really right.</p>



<a name="216878017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878017">(Nov 16 2020 at 14:30)</a>:</h4>
<p>Well, there is .. hold on...</p>



<a name="216878142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878142">(Nov 16 2020 at 14:31)</a>:</h4>
<p>OK, there is <a href="https://github.com/rust-lang/rust/issues/68318">https://github.com/rust-lang/rust/issues/68318</a></p>



<a name="216878150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878150">(Nov 16 2020 at 14:31)</a>:</h4>
<p>it is going to be need some updating :)</p>



<a name="216878220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878220">(Nov 16 2020 at 14:32)</a>:</h4>
<p>ah! great!</p>



<a name="216878250"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878250" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878250">(Nov 16 2020 at 14:32)</a>:</h4>
<p>(I think we can kind of turn it into a proper tracking issue and add it to the lang team project board etc)</p>



<a name="216878277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878277">(Nov 16 2020 at 14:32)</a>:</h4>
<p>cool</p>



<a name="216878281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878281">(Nov 16 2020 at 14:32)</a>:</h4>
<p>one thing that is not clear to me though is what the overall aims are here :)</p>



<a name="216878294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878294">(Nov 16 2020 at 14:32)</a>:</h4>
<p>I mean I have designs in my head</p>



<a name="216878312"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878312" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878312">(Nov 16 2020 at 14:32)</a>:</h4>
<p>what I don't know is how far we'll want to push them</p>



<a name="216878322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878322">(Nov 16 2020 at 14:32)</a>:</h4>
<p>Of the work that I would be doing?</p>



<a name="216878346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878346">(Nov 16 2020 at 14:33)</a>:</h4>
<p>but I think that we can start by writing out the steps and general ways forward and we'll see how far we feel like going</p>



<a name="216878378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878378">(Nov 16 2020 at 14:33)</a>:</h4>
<p>yeah, I mean, to start I think we want to cleanup the code, that is not controversial</p>



<a name="216878431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878431">(Nov 16 2020 at 14:33)</a>:</h4>
<p>if we wanted to go <em>further</em> I think there would be room to write an RFC that tries to make negative impls accessible to users</p>



<a name="216878439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878439">(Nov 16 2020 at 14:33)</a>:</h4>
<p>i.e., outside the stdlib</p>



<a name="216878509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878509">(Nov 16 2020 at 14:34)</a>:</h4>
<p>the current status is a bit "in between"</p>



<a name="216878589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878589">(Nov 16 2020 at 14:34)</a>:</h4>
<p>we landed some changes in stdlib that rely on negative impls but I think we're in need of another RFC that writes out the semantics and justification etc</p>



<a name="216878706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878706">(Nov 16 2020 at 14:35)</a>:</h4>
<p>the closest we have is the text from opt-in builtin traits RFC and it is a bit dated</p>



<a name="216878728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878728">(Nov 16 2020 at 14:35)</a>:</h4>
<p>Full disclosure: I do have the selfish goal of getting a masters thesis out of this. So that would involve potentially formally describing the behavior and how it works (the lab is focused around parallelization, and this initial writeup struck me as something that could be expanded: <a href="https://github.com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md">https://github.com/rust-lang/rfcs/blob/master/text/0019-opt-in-builtin-traits.md</a>) to enable writing parallelizable code? maybe? (I haven't been able to get in touch with the professor yet on this)</p>



<a name="216878770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878770">(Nov 16 2020 at 14:36)</a>:</h4>
<p>hmm, I'm not sure how this would effect parallelization</p>



<a name="216878833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216878833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216878833">(Nov 16 2020 at 14:36)</a>:</h4>
<p>but I'm in favor of people getting theses :)</p>



<a name="216879064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879064">(Nov 16 2020 at 14:38)</a>:</h4>
<p>I guess I was looking specifically at how default traits and negative impls were being used for send and share, but maybe its not so relevant</p>



<a name="216879126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879126">(Nov 16 2020 at 14:38)</a>:</h4>
<p>well</p>



<a name="216879139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879139">(Nov 16 2020 at 14:38)</a>:</h4>
<p>and this as an alternative for opt-in</p>



<a name="216879151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879151">(Nov 16 2020 at 14:38)</a>:</h4>
<p>yeah it is connected to rust's parallel story</p>



<a name="216879182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879182">(Nov 16 2020 at 14:39)</a>:</h4>
<p>(i am not attached to this idea)</p>



<a name="216879249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879249">(Nov 16 2020 at 14:39)</a>:</h4>
<p>If you are looking for parallelization-related ideas, we should discuss, there might be some other things, have to think about it</p>



<a name="216879334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879334">(Nov 16 2020 at 14:40)</a>:</h4>
<p>Well, I can probably find a professor to work with regardless. We can just see how it develops</p>



<a name="216879336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879336">(Nov 16 2020 at 14:40)</a>:</h4>
<p>I do think that negative impls in general might be a nice scope for a master's thesis though</p>



<a name="216879381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879381">(Nov 16 2020 at 14:40)</a>:</h4>
<p>yeah i think so too. I think I'm also still wrapping my head around it and there might be something more interesting there</p>



<a name="216879435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879435">(Nov 16 2020 at 14:41)</a>:</h4>
<p>ok, let's put theses aside for now and discuss that privately =) are you interested to try and hack on the PR in any case?</p>



<a name="216879439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879439">(Nov 16 2020 at 14:41)</a>:</h4>
<p>ok</p>



<a name="216879448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879448">(Nov 16 2020 at 14:41)</a>:</h4>
<p>yes!</p>



<a name="216879453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879453">(Nov 16 2020 at 14:41)</a>:</h4>
<p>let me get it set up</p>



<a name="216879581"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879581" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879581">(Nov 16 2020 at 14:42)</a>:</h4>
<p>I think I will create an issue for this specific change</p>



<a name="216879589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879589">(Nov 16 2020 at 14:42)</a>:</h4>
<p>I don't think one currently exists</p>



<a name="216879637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879637">(Nov 16 2020 at 14:42)</a>:</h4>
<p>oh well I guess that <a href="https://github.com/rust-lang/rust/issues/74629">#74629</a></p>



<a name="216879824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879824">(Nov 16 2020 at 14:44)</a>:</h4>
<p>I'm going to make one anyway :)</p>



<a name="216879874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216879874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216879874">(Nov 16 2020 at 14:44)</a>:</h4>
<p>Should an issue also exist for forbidding negative impls for traits that have multiple input types?</p>



<a name="216880275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216880275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216880275">(Nov 16 2020 at 14:48)</a>:</h4>
<p>oke, i have the code... and the buil is failing, i'll see why</p>



<a name="216880308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216880308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216880308">(Nov 16 2020 at 14:48)</a>:</h4>
<p><span class="user-mention" data-user-id="362503">@Yulia Startsev</span> I created <a href="https://github.com/rust-lang/rust/issues/79098">https://github.com/rust-lang/rust/issues/79098</a></p>



<a name="216880329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216880329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216880329">(Nov 16 2020 at 14:48)</a>:</h4>
<p>you can do <code>@rustbot claim</code> to claim it</p>



<a name="216880655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216880655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216880655">(Nov 16 2020 at 14:51)</a>:</h4>
<p>cool</p>



<a name="216880667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216880667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216880667">(Nov 16 2020 at 14:51)</a>:</h4>
<p>you also mentioned that there is cleanup?</p>



<a name="216880948"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216880948" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216880948">(Nov 16 2020 at 14:53)</a>:</h4>
<p><span class="user-mention" data-user-id="362503">@Yulia Startsev</span> well this is the first bit of cleanup, I would say</p>



<a name="216881050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881050">(Nov 16 2020 at 14:53)</a>:</h4>
<p>let's start with this and I'll put in a bit of thought into what is the best next step</p>



<a name="216881201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881201">(Nov 16 2020 at 14:54)</a>:</h4>
<p>ok, sounds good</p>



<a name="216881215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881215">(Nov 16 2020 at 14:54)</a>:</h4>
<p>did I send you <a href="https://hackmd.io/2FYm23s0R-igRnTLaFoo8w">this hackmd</a>?</p>



<a name="216881343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881343">(Nov 16 2020 at 14:55)</a>:</h4>
<p>hmm looks like no</p>



<a name="216881351"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881351" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881351">(Nov 16 2020 at 14:55)</a>:</h4>
<p>first time i see it</p>



<a name="216881371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881371">(Nov 16 2020 at 14:55)</a>:</h4>
<p>ok, I just added a link t the tracking issue</p>



<a name="216881386"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881386" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881386">(Nov 16 2020 at 14:55)</a>:</h4>
<p>oh wait</p>



<a name="216881391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881391">(Nov 16 2020 at 14:55)</a>:</h4>
<p>yes you did</p>



<a name="216881401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881401">(Nov 16 2020 at 14:56)</a>:</h4>
<p>that was the writeup I did when we landed preliminary support for negative impls</p>



<a name="216881463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881463">(Nov 16 2020 at 14:56)</a>:</h4>
<p>it kind of sketches out the direction I see this as going in I think</p>



<a name="216881528"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881528" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881528">(Nov 16 2020 at 14:56)</a>:</h4>
<p>but there are some tricky corners ...</p>



<a name="216881622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881622">(Nov 16 2020 at 14:57)</a>:</h4>
<p><span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> read this discussion and the hackmd</p>



<a name="216881931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881931">(Nov 16 2020 at 14:59)</a>:</h4>
<p>thanks for <span class="user-mention silent" data-user-id="362503">Yulia Startsev</span> for picking up <a href="https://github.com/rust-lang/rust/issues/74648">#74648</a>, I think I wanted to pretty much refactor this PR to move all possible types into the path we currently use for <code>ty::Adt</code> so that we can reuse the existing infrastructure and don't have to add any new code to fix the open review comments by <span class="user-mention silent" data-user-id="116009">nikomatsakis</span></p>



<a name="216881974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216881974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216881974">(Nov 16 2020 at 14:59)</a>:</h4>
<p>though it's probably fine to solve this differently as I haven't tried doing so myself <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="216882107"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882107" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882107">(Nov 16 2020 at 15:00)</a>:</h4>
<p>re <a href="https://hackmd.io/2FYm23s0R-igRnTLaFoo8w#Permit-T-Trait-where-clauses">https://hackmd.io/2FYm23s0R-igRnTLaFoo8w#Permit-T-Trait-where-clauses</a></p>
<p>doesn't this once again have weird isses because of static lifetimes?</p>



<a name="216882237"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882237" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882237">(Nov 16 2020 at 15:01)</a>:</h4>
<p>I don't think so, but you have to understand what I had in mind there</p>



<a name="216882274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882274">(Nov 16 2020 at 15:01)</a>:</h4>
<p>the idea is quite different from what chalk implements as <code>not { G }</code> goals</p>



<a name="216882298"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882298" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882298">(Nov 16 2020 at 15:01)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;'</span><span class="nb">static</span><span class="w"> </span><span class="kt">u32</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">fn</span> <span class="nf">foo</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kt">usize</span> <span class="p">{</span><span class="w"> </span><span class="mi">3</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span>: <span class="o">!</span><span class="n">Foo</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
<span class="k">impl</span><span class="w"> </span><span class="n">Bar</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;'</span><span class="nb">static</span><span class="w"> </span><span class="kt">u32</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">fn</span> <span class="nf">foo</span><span class="p">()</span><span class="w"> </span>-&gt; <span class="kt">usize</span> <span class="p">{</span><span class="w"> </span><span class="mi">4</span><span class="w"> </span><span class="p">}</span><span class="w"> </span><span class="p">}}</span><span class="w"></span>
</code></pre></div>



<a name="216882301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882301">(Nov 16 2020 at 15:01)</a>:</h4>
<p>the idea would be that you can only prove <code>T: !Trait</code> if you can find some negative impl</p>



<a name="216882367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882367">(Nov 16 2020 at 15:02)</a>:</h4>
<p>so e.g. it would not be provable in that case</p>



<a name="216882393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882393">(Nov 16 2020 at 15:02)</a>:</h4>
<p>but if you have a <code>impl !Foo for &amp;'static u32 { }</code>, it would be</p>



<a name="216882405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882405">(Nov 16 2020 at 15:02)</a>:</h4>
<p><del>well, sorry, it wouldn't be</del></p>



<a name="216882454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882454">(Nov 16 2020 at 15:02)</a>:</h4>
<p>I'm not being very clear about what "it" is</p>



<a name="216882529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882529">(Nov 16 2020 at 15:03)</a>:</h4>
<p>in any case the semantics would be roughly the same as if you had defined two traits</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="k">trait</span><span class="w"> </span><span class="n">NotFoo</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>and <code>T: !Foo</code> were translated to <code>T: NotFoo</code></p>



<a name="216882557"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882557" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882557">(Nov 16 2020 at 15:03)</a>:</h4>
<p>the main difference would be that coherence would guarantee that <code>Foo</code> and <code>NotFoo</code> impls cannot overlap</p>



<a name="216882629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882629">(Nov 16 2020 at 15:04)</a>:</h4>
<p>in your example above there are no explicit negative impls, so <code>!Foo</code> would never be provable</p>



<a name="216882763"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882763" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882763">(Nov 16 2020 at 15:04)</a>:</h4>
<p>ah yeah <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span></p>



<a name="216882891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216882891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216882891">(Nov 16 2020 at 15:05)</a>:</h4>
<p>what does "no explicit negative impls" mean? I would have expected <code>impl&lt;T: !Foo&gt; Bar for T {}</code> to be explicit, but clearly it isn't</p>



<a name="216883008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883008">(Nov 16 2020 at 15:06)</a>:</h4>
<p>you have to explicitly implement "not Foo" or "!Foo", so <code>impl&lt;T&gt; !Foo for T {}</code> would be an explicit impl</p>



<a name="216883016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883016">(Nov 16 2020 at 15:06)</a>:</h4>
<p>iiuc</p>



<a name="216883025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883025">(Nov 16 2020 at 15:06)</a>:</h4>
<p>Got it</p>



<a name="216883296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883296">(Nov 16 2020 at 15:08)</a>:</h4>
<p>yes</p>



<a name="216883300"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883300" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883300">(Nov 16 2020 at 15:08)</a>:</h4>
<p>one way to think about this is</p>



<a name="216883315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883315">(Nov 16 2020 at 15:08)</a>:</h4>
<p>from the lens of semver</p>



<a name="216883330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883330">(Nov 16 2020 at 15:08)</a>:</h4>
<p>if you haven't declared whether <code>Foo</code> is implemented or not</p>



<a name="216883345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883345">(Nov 16 2020 at 15:08)</a>:</h4>
<p>you may want to "reserve the right" to add an impl later</p>



<a name="216883390"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883390" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883390">(Nov 16 2020 at 15:08)</a>:</h4>
<p>but if we allow <code>T: !Foo</code> to be considered true just beacuse you haven't written an impl <em>yet</em>, does that make sense?</p>



<a name="216883445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883445">(Nov 16 2020 at 15:09)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls/near/216881528">said</a>:</p>
<blockquote>
<p>but there are some tricky corners ...</p>
</blockquote>
<p>this gets into the tricky corners though, as we currently <em>do</em> permit some amount of negative reasoning, but only "intra crate"</p>



<a name="216883520"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883520" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883520">(Nov 16 2020 at 15:10)</a>:</h4>
<p><a href="https://rust-lang.github.io/rfcs/1023-rebalancing-coherence.html">RFC 1023</a> talks about this, along with <a href="https://rust-lang.github.io/rfcs/2451-re-rebalancing-coherence.html">RFC 2451</a></p>



<a name="216883571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216883571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216883571">(Nov 16 2020 at 15:10)</a>:</h4>
<p>ideally we'd subsume these nicely together</p>



<a name="216884561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216884561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216884561">(Nov 16 2020 at 15:16)</a>:</h4>
<p>I have a bit of reading to do it looks like</p>



<a name="216884636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216884636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216884636">(Nov 16 2020 at 15:17)</a>:</h4>
<p>I guess, as next steps what I will do is see if i can address the comments on 74648? is that a good place to start?</p>



<a name="216884877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216884877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216884877">(Nov 16 2020 at 15:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls/near/216881931">said</a>:</p>
<blockquote>
<p>thanks for <span class="user-mention silent" data-user-id="362503">Yulia Startsev</span> for picking up <a href="https://github.com/rust-lang/rust/issues/74648">#74648</a>, I think I wanted to pretty much refactor this PR to move all possible types into the path we currently use for <code>ty::Adt</code> so that we can reuse the existing infrastructure and don't have to add any new code to fix the open review comments by <span class="user-mention silent" data-user-id="116009">nikomatsakis</span></p>
</blockquote>
<p>i think so, yeah. Either by trying what i recommended above or by copying some code <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> I think adding a special-case for <code>Sized</code> is probably easier for now</p>



<a name="216885043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216885043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216885043">(Nov 16 2020 at 15:20)</a>:</h4>
<p>ok, that is what i will look into this week then</p>



<a name="216968518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/216968518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pksunkara <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#216968518">(Nov 17 2020 at 05:43)</a>:</h4>
<p>So, I understand where you are coming from regarding not supporting <code>!Foo</code> as absence of <code>Foo</code>, but how would I achieve <a href="#narrow/stream/144729-wg-traits/topic/negative.20bounds/near/216799475">this scenario</a>? This was the second time I wanted something like that in one my libraries</p>



<a name="218111355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218111355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218111355">(Nov 27 2020 at 16:53)</a>:</h4>
<p>A quick update here, I have the work that lcnr did rebased and working, now I am doing the suggested refactoring and trying to wrap my head around it</p>



<a name="218111365"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218111365" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218111365">(Nov 27 2020 at 16:53)</a>:</h4>
<p>sorry its taking a while (coding during vacation is a bit hard)</p>



<a name="218160427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218160427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218160427">(Nov 28 2020 at 11:37)</a>:</h4>
<p>oh geez, rust is indexed by search fox. 1) thank goodness, 2) i wish i realized sooner</p>



<a name="218161078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218161078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218161078">(Nov 28 2020 at 11:55)</a>:</h4>
<p>ok so dumb question, lcnr -- is the goal in sharing the code with the adt code path _primarily_ to solve the T: sized issue? so applying mostly to slice and Array? Or am I missing a comment somewhere?</p>



<a name="218161275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218161275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218161275">(Nov 28 2020 at 12:00)</a>:</h4>
<p>i think so</p>



<a name="218161301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218161301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218161301">(Nov 28 2020 at 12:01)</a>:</h4>
<p>maybe it is easier to only check for sized and move these error messages into a separate method if they aren't already?</p>



<a name="218291382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291382">(Nov 30 2020 at 14:17)</a>:</h4>
<p>ok so <span class="user-mention" data-user-id="362503">@Yulia Startsev</span> ..</p>



<a name="218291398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291398">(Nov 30 2020 at 14:17)</a>:</h4>
<p>This morning Niko and I are looking over this again. I didn't get any further than when I asked the above question. Basically, where i am stuck is what the next step should look like</p>



<a name="218291406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291406">(Nov 30 2020 at 14:17)</a>:</h4>
<p>hi</p>



<a name="218291464"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291464" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291464">(Nov 30 2020 at 14:17)</a>:</h4>
<p>ok so I'm looking a bit more at the PR now</p>



<a name="218291551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291551">(Nov 30 2020 at 14:18)</a>:</h4>
<p>so you asked about the comments like</p>



<a name="218291561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291561">(Nov 30 2020 at 14:18)</a>:</h4>
<blockquote>
<div class="codehilite"><pre><span></span><code>         // FIXME: Support negative impls for `[T; N]` where `T: Sized` is the only predicate.
</code></pre></div>

</blockquote>



<a name="218291589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291589">(Nov 30 2020 at 14:18)</a>:</h4>
<p>part of this is that a type like <code>[T]</code> is only well-formed if <code>T: Sized</code></p>



<a name="218291650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291650">(Nov 30 2020 at 14:19)</a>:</h4>
<p>so I imagine that is why we <em>want</em> to support such negative impls</p>



<a name="218291676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291676">(Nov 30 2020 at 14:19)</a>:</h4>
<p>so that people can write <code>impl&lt;T&gt; !Foo for [T]</code></p>



<a name="218291691"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291691" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291691">(Nov 30 2020 at 14:19)</a>:</h4>
<p>(hmm, there is an interesting semver interaction I hadn't considered...)</p>



<a name="218291756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291756">(Nov 30 2020 at 14:20)</a>:</h4>
<p>if we permit negative impls in arbitrary code</p>



<a name="218291767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291767">(Nov 30 2020 at 14:20)</a>:</h4>
<p>and we require that negative impls match the WF clauses on a type exactly</p>



<a name="218291808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291808">(Nov 30 2020 at 14:20)</a>:</h4>
<p>then if you have a type like <code>struct MyType&lt;T: Ord&gt;</code> and you change it to <code>struct MyType&lt;T&gt;</code></p>



<a name="218291843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291843">(Nov 30 2020 at 14:20)</a>:</h4>
<p>some downstream crate could have <code>impl&lt;T: Ord&gt; !Trait for MyType&lt;T&gt;</code>, which would become an error</p>



<a name="218291887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291887">(Nov 30 2020 at 14:21)</a>:</h4>
<p>(this is related to implied bounds, which -- in some incarnations -- would also make that an error)</p>



<a name="218291921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291921">(Nov 30 2020 at 14:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls/near/218291676">said</a>:</p>
<blockquote>
<p>so that people can write <code>impl&lt;T&gt; !Foo for [T]</code></p>
</blockquote>
<p>note that there is an implied <code>T: Sized</code> bound here</p>



<a name="218291942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218291942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218291942">(Nov 30 2020 at 14:21)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls/near/218291589">said</a>:</p>
<blockquote>
<p>part of this is that a type like <code>[T]</code> is only well-formed if <code>T: Sized</code></p>
</blockquote>
<p>are you familiar with the phrase "well-formed", <span class="user-mention" data-user-id="362503">@Yulia Startsev</span>?</p>



<a name="218292031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292031">(Nov 30 2020 at 14:22)</a>:</h4>
<p>not as well as i would like to be, i guess this is what "WF" stands for earlier?</p>



<a name="218292076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292076">(Nov 30 2020 at 14:22)</a>:</h4>
<p>yes</p>



<a name="218292097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292097">(Nov 30 2020 at 14:23)</a>:</h4>
<p>it just means that the type is "valid", so to speak</p>



<a name="218292135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292135">(Nov 30 2020 at 14:23)</a>:</h4>
<p>ok, that fits with what i thought it would mean</p>



<a name="218292160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292160">(Nov 30 2020 at 14:23)</a>:</h4>
<p>i also have another question, just to help with my reading of the code</p>



<a name="218292165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292165">(Nov 30 2020 at 14:23)</a>:</h4>
<p>so if you have <code>struct MyType&lt;T: Ord&gt;</code>, then <code>MyType&lt;X&gt;</code> is only valid if <code>X: Ord</code></p>



<a name="218292259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292259">(Nov 30 2020 at 14:24)</a>:</h4>
<p>would you read <code>impl&lt;T&gt; !Foo for [T]</code> as "Implement 'not-foo' by default for all types"? is that the right reading?</p>



<a name="218292299"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292299" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292299">(Nov 30 2020 at 14:24)</a>:</h4>
<p>I would read that as "<code>Foo</code> will never be implemented for <code>[T]</code> for any <code>T</code>"</p>



<a name="218292352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292352">(Nov 30 2020 at 14:25)</a>:</h4>
<p>ok</p>



<a name="218292371"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292371" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292371">(Nov 30 2020 at 14:25)</a>:</h4>
<p>i.e., for no slice types</p>



<a name="218292399"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292399" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292399">(Nov 30 2020 at 14:25)</a>:</h4>
<p>that makes sense, i tripped on the syntax</p>



<a name="218292489"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292489" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292489">(Nov 30 2020 at 14:26)</a>:</h4>
<p>ok, back to the question at hand -- this probably has an impact on semver?</p>



<a name="218292577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292577">(Nov 30 2020 at 14:26)</a>:</h4>
<p>yes, well, if we were to stabilize negative impls with the rule that they must match the WF rules for their type exactly</p>



<a name="218292635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292635">(Nov 30 2020 at 14:27)</a>:</h4>
<p>and using the "obvious" coherence rules (i.e., you can write a <code>impl !Foo</code> for some set of types iff yuo can write <code>impl Foo</code> for those same types)</p>



<a name="218292665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292665">(Nov 30 2020 at 14:27)</a>:</h4>
<p>(which makes sense -- if you are the one permitted to implement the trait, you are also permitted to promise never to do so)</p>



<a name="218292688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292688">(Nov 30 2020 at 14:27)</a>:</h4>
<p>then there would be a semver implication</p>



<a name="218292788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292788">(Nov 30 2020 at 14:28)</a>:</h4>
<p>this is not necessarily a problem</p>



<a name="218292795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292795">(Nov 30 2020 at 14:28)</a>:</h4>
<p>but it is interesting and something I hadn't considered before</p>



<a name="218292842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292842">(Nov 30 2020 at 14:28)</a>:</h4>
<p>in the long run I don't see any reason to restrict what kinds of negative impls one can write</p>



<a name="218292866"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292866" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292866">(Nov 30 2020 at 14:29)</a>:</h4>
<p>ok, that makes sense</p>



<a name="218292964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218292964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218292964">(Nov 30 2020 at 14:29)</a>:</h4>
<p>it's worth revisiting <em>why</em> I wanted to impose these rules</p>



<a name="218293022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293022">(Nov 30 2020 at 14:30)</a>:</h4>
<p>I think that it was <em>mainly</em> because of non-obvious semantics with auto traits</p>



<a name="218293087"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293087" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293087">(Nov 30 2020 at 14:30)</a>:</h4>
<p>that is, people might have a type like <code>struct Foo&lt;T&gt; { }</code> and then write <code>impl&lt;T: Ord&gt; !Send for Foo&lt;T&gt;</code></p>



<a name="218293114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293114">(Nov 30 2020 at 14:30)</a>:</h4>
<p>and it would raise the question: does that mean that <code>Foo&lt;T&gt;: Send</code> unless <code>T: Ord</code>?</p>



<a name="218293142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293142">(Nov 30 2020 at 14:31)</a>:</h4>
<p>the way the current code works, it does not, it means effectively that <code>Foo&lt;T&gt;</code> is never <code>Send</code></p>



<a name="218293175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293175">(Nov 30 2020 at 14:31)</a>:</h4>
<p>because the negative impl "turns off" the default impl we would otherwise have provided completely</p>



<a name="218293218"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293218" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293218">(Nov 30 2020 at 14:31)</a>:</h4>
<p>similaly if you write <code>unsafe impl Send for Foo&lt;u32&gt;</code>, that means (today) that <code>Foo&lt;u32&gt;</code> is the only type which is <code>Send</code>, because the default (automatic) impl is suppressed</p>



<a name="218293224"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293224" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293224">(Nov 30 2020 at 14:31)</a>:</h4>
<p>(the latter is I think stable...)</p>



<a name="218293293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293293">(Nov 30 2020 at 14:32)</a>:</h4>
<p>interesting. i would have expected the first outcome</p>



<a name="218293311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293311">(Nov 30 2020 at 14:32)</a>:</h4>
<p>a lot of people expect that</p>



<a name="218293405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293405">(Nov 30 2020 at 14:33)</a>:</h4>
<p>this is partly why I wanted to sidestep the question by just not permitted the impl in question</p>



<a name="218293428"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293428" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293428">(Nov 30 2020 at 14:33)</a>:</h4>
<p>an interesting point though is that this applies <em>only</em> to auto traits</p>



<a name="218293465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293465">(Nov 30 2020 at 14:33)</a>:</h4>
<p>(which themselves are a non-stable mechanism)</p>



<a name="218293491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293491">(Nov 30 2020 at 14:33)</a>:</h4>
<p>this is partly interesting because maybe we would only need this limitation <em>for</em> auto traits</p>



<a name="218293518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293518">(Nov 30 2020 at 14:34)</a>:</h4>
<p>this would, at least temporarily, sidestep the semver concerns</p>



<a name="218293551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293551">(Nov 30 2020 at 14:34)</a>:</h4>
<p>since all auto traits are declared in the stdlib</p>



<a name="218293586"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293586" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293586">(Nov 30 2020 at 14:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls/near/218293218">said</a>:</p>
<blockquote>
<p>similaly if you write <code>unsafe impl Send for Foo&lt;u32&gt;</code>, that means (today) that <code>Foo&lt;u32&gt;</code> is the only type which is <code>Send</code>, because the default (automatic) impl is suppressed</p>
</blockquote>
<p>i don't think this is the case <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=fad4a98a4e99a834b770a06cd318690a">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=fad4a98a4e99a834b770a06cd318690a</a></p>



<a name="218293599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293599">(Nov 30 2020 at 14:34)</a>:</h4>
<p>but if i make sense of it, it reminds you that you described <code>!Foo</code> as being sort of like <code>NotFoo</code> (basically, a regular impl) and that would be an implementation... if i understand correctly, having a regular implementation would override the default implementations? If we stop talking about negative implementations that is</p>



<a name="218293637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293637">(Nov 30 2020 at 14:34)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls/near/218293586">said</a>:</p>
<blockquote>
<p>i don't think this is the case <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=fad4a98a4e99a834b770a06cd318690a">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=fad4a98a4e99a834b770a06cd318690a</a></p>
</blockquote>
<p>oh, interesting</p>



<a name="218293643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293643">(Nov 30 2020 at 14:34)</a>:</h4>
<p>hmm :)</p>



<a name="218293649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293649">(Nov 30 2020 at 14:34)</a>:</h4>
<p>i don't know if that is the right mental model though</p>



<a name="218293688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293688">(Nov 30 2020 at 14:35)</a>:</h4>
<p>I was just going to go test that to make sure what I was saying was true</p>



<a name="218293693"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293693" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293693">(Nov 30 2020 at 14:35)</a>:</h4>
<p>well, that changes things</p>



<a name="218293703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293703">(Nov 30 2020 at 14:35)</a>:</h4>
<p>I guess somehow the impl changed at some point :)</p>



<a name="218293717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293717">(Nov 30 2020 at 14:35)</a>:</h4>
<p>/me wonders if we don't have tests around this</p>



<a name="218293730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293730">(Nov 30 2020 at 14:35)</a>:</h4>
<p>you can use <code>Send</code> to implement overlapping impls on stable (<a href="https://twitter.com/lcnr7/status/1295361144564207617">https://twitter.com/lcnr7/status/1295361144564207617</a>)</p>
<div class="inline-preview-twitter"><div class="twitter-tweet"><a href="https://twitter.com/lcnr7/status/1295361144564207617"><img class="twitter-avatar" src="https://pbs.twimg.com/profile_images/1243258148368064518/oXqxwD9M_normal.png"></a><p>type level maps are actually possible in stable rust <span aria-label="sparkles" class="emoji emoji-2728" role="img" title="sparkles">:sparkles:</span>

<a href="https://t.co/1sqYcaARfh">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=bc59202b698e458f98dc5f7eb9e98741</a> <a href="https://t.co/HR89UHJiaa">https://twitter.com/lcnr7/status/1295361144564207617/photo/1</a></p><span>- lcnr (@lcnr7)</span><div class="twitter-image"><a href="https://t.co/HR89UHJiaa"><img src="https://pbs.twimg.com/media/EfoLTkTWAAUAh7q.jpg:thumb"></a></div></div></div>



<a name="218293857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293857">(Nov 30 2020 at 14:36)</a>:</h4>
<p>well, that means what I wrote above is wrong with respect to positive impls, which is perhaps not a bad thing</p>



<a name="218293875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293875">(Nov 30 2020 at 14:36)</a>:</h4>
<p>though I personally .. hmm</p>



<a name="218293893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293893">(Nov 30 2020 at 14:37)</a>:</h4>
<p>I guess I find both behaviors surprising in their own way :)</p>



<a name="218293969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218293969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218293969">(Nov 30 2020 at 14:37)</a>:</h4>
<p>on the one hand, if I see <em>any</em> impls, it surprises me not to see <em>all</em> of them</p>



<a name="218294123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294123">(Nov 30 2020 at 14:38)</a>:</h4>
<p>on the other, it is surprising to have the default impl disappear</p>



<a name="218294151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294151">(Nov 30 2020 at 14:38)</a>:</h4>
<p>that said, it implies that negative impls are "specializing" the default impl</p>



<a name="218294165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294165">(Nov 30 2020 at 14:38)</a>:</h4>
<p>which isn't really a valid interpretation</p>



<a name="218294205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294205">(Nov 30 2020 at 14:39)</a>:</h4>
<p>urg. im falling behind a bit</p>



<a name="218294234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294234">(Nov 30 2020 at 14:39)</a>:</h4>
<p>sorry, I'm thinking out loud a bit</p>



<a name="218294251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294251">(Nov 30 2020 at 14:39)</a>:</h4>
<p>in the example that lcnr posted, you would have expected that to not compile, is that right?</p>



<a name="218294275"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294275" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294275">(Nov 30 2020 at 14:39)</a>:</h4>
<p>based on what I wrote above, yes</p>



<a name="218294290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294290">(Nov 30 2020 at 14:39)</a>:</h4>
<p>ok, good im followingg again</p>



<a name="218294363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294363">(Nov 30 2020 at 14:40)</a>:</h4>
<p>at some point I had a model of how auto traits should work where the idea was that <em>if</em> you wrote any impl (positive or negative), the default impl was suppressed</p>



<a name="218294377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294377">(Nov 30 2020 at 14:40)</a>:</h4>
<p>but that no longer matches the impl, for better or worse</p>



<a name="218294407"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294407" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294407">(Nov 30 2020 at 14:40)</a>:</h4>
<p>heh maybe it never did</p>



<a name="218294483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294483">(Nov 30 2020 at 14:40)</a>:</h4>
<p>and that would be suppressed for all types?</p>



<a name="218294525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294525">(Nov 30 2020 at 14:41)</a>:</h4>
<p>that said</p>



<a name="218294542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294542">(Nov 30 2020 at 14:41)</a>:</h4>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="cp">#![feature(negative_impls)]</span><span class="w"></span>

<span class="k">struct</span> <span class="nc">Foo</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">T</span><span class="p">);</span><span class="w"></span>

<span class="k">impl</span><span class="w"> </span><span class="o">!</span><span class="nb">Send</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Foo</span><span class="o">&lt;</span><span class="kt">u8</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">test</span><span class="o">&lt;</span><span class="n">T</span>: <span class="nb">Send</span><span class="o">&gt;</span><span class="p">()</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">test</span>::<span class="o">&lt;</span><span class="n">Foo</span><span class="o">&lt;</span><span class="kt">u16</span><span class="o">&gt;&gt;</span><span class="p">();</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>this seems to compile too</p>



<a name="218294570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294570">(Nov 30 2020 at 14:41)</a>:</h4>
<p>yeah, but type inference is now broken</p>



<a name="218294594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294594">(Nov 30 2020 at 14:41)</a>:</h4>
<p>because of <code>auto \ neg-impl</code></p>



<a name="218294703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294703">(Nov 30 2020 at 14:42)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/74383">#74383</a></p>



<a name="218294719"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294719" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294719">(Nov 30 2020 at 14:42)</a>:</h4>
<p>i.e., if we do <code>test::&lt;Foo&lt;_&gt;&gt;</code>, then the <code>_</code> gets inferred to <code>u8</code>?</p>



<a name="218294768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294768">(Nov 30 2020 at 14:42)</a>:</h4>
<p>yes ok</p>



<a name="218294799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294799">(Nov 30 2020 at 14:43)</a>:</h4>
<p>ok so <span class="user-mention" data-user-id="362503">@Yulia Startsev</span> basically everything I wrote above was wrong :)</p>



<a name="218294804"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294804" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294804">(Nov 30 2020 at 14:43)</a>:</h4>
<p>i think so, or much rather, we look at the negative impl and think that <code>Foo&lt;_&gt;</code> is not implemented</p>



<a name="218294819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294819">(Nov 30 2020 at 14:43)</a>:</h4>
<p>which affects what I think is the correct course of action somewhat</p>



<a name="218294862"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294862" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294862">(Nov 30 2020 at 14:43)</a>:</h4>
<p>huh, neat</p>



<a name="218294961"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294961" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294961">(Nov 30 2020 at 14:44)</a>:</h4>
<p>(though this also means that the way chalk models auto traits is wrong)</p>



<a name="218294984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218294984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218294984">(Nov 30 2020 at 14:44)</a>:</h4>
<p>(but that should be fixable)</p>



<a name="218295023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295023">(Nov 30 2020 at 14:44)</a>:</h4>
<p>(actually it's probably <em>easier</em>)</p>



<a name="218295072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295072">(Nov 30 2020 at 14:44)</a>:</h4>
<p>ohh cool, i didn't realize what chalk was</p>



<a name="218295076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295076">(Nov 30 2020 at 14:44)</a>:</h4>
<p>thats really neat</p>



<a name="218295290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295290">(Nov 30 2020 at 14:46)</a>:</h4>
<p>wow, this is amazing but also a tiny bit overwhelming</p>



<a name="218295308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295308">(Nov 30 2020 at 14:46)</a>:</h4>
<p>yeah, that's ok, I'm pondering a bit</p>



<a name="218295318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295318">(Nov 30 2020 at 14:46)</a>:</h4>
<p>I thikn I need to go look at the impl again</p>



<a name="218295337"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295337" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295337">(Nov 30 2020 at 14:46)</a>:</h4>
<p>one option might be to investigate and/or fix the type inference behavior</p>



<a name="218295350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295350">(Nov 30 2020 at 14:46)</a>:</h4>
<p>can i look as well? do you mean the implementation of impl in rustlang or something else?</p>



<a name="218295376"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295376" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295376">(Nov 30 2020 at 14:46)</a>:</h4>
<p>I meant the impl in rust-lang</p>



<a name="218295413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295413">(Nov 30 2020 at 14:47)</a>:</h4>
<p>yeah I mean I think it could be useful to go look at what happens in the examples above and why they come out as true</p>



<a name="218295443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295443">(Nov 30 2020 at 14:47)</a>:</h4>
<p>I can sort of imagine but I want to refresh my memory, we could look at it a bit together if you wanted</p>



<a name="218295475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295475">(Nov 30 2020 at 14:47)</a>:</h4>
<p>I guess that based on this another wya forward would be to <strong>not</strong> put limits on negative impls but just permit them</p>



<a name="218295498"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295498" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295498">(Nov 30 2020 at 14:47)</a>:</h4>
<p>I will hit my timebox for today in a few minutes, but if you ccome up with some interesting examples of things that should or shouldn't work</p>



<a name="218295518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295518">(Nov 30 2020 at 14:48)</a>:</h4>
<p>and instead look into some of the things we might <em>do with them</em></p>



<a name="218295550"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295550" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295550">(Nov 30 2020 at 14:48)</a>:</h4>
<p>i can also poke around and see if i can make sense of them</p>



<a name="218295596"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295596" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295596">(Nov 30 2020 at 14:48)</a>:</h4>
<p>right, maybe one thing might be to take a look at how negative impls might or might not be used...</p>



<a name="218295602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295602">(Nov 30 2020 at 14:48)</a>:</h4>
<p>(e.g., integrating them a bit into coherence checking, that was one of my main interests)</p>



<a name="218295634"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295634" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295634">(Nov 30 2020 at 14:48)</a>:</h4>
<p>I'd like to permit <code>impl&lt;T: Copy&gt; Foo for T</code> and <code>impl&lt;T&gt; Foo for Box&lt;T&gt;</code>, which today doesn't work</p>



<a name="218295650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295650">(Nov 30 2020 at 14:48)</a>:</h4>
<p>the idea would be to have <code>impl !Copy for Box&lt;T&gt;</code></p>



<a name="218295657"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295657" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295657">(Nov 30 2020 at 14:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls/near/218295337">said</a>:</p>
<blockquote>
<p>one option might be to investigate and/or fix the type inference behavior</p>
</blockquote>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> i think i already tried this in <a href="https://github.com/rust-lang/rust/issues/74525">#74525</a></p>



<a name="218295705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295705">(Nov 30 2020 at 14:49)</a>:</h4>
<p>yeah I thought you might've</p>



<a name="218295707"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295707" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295707">(Nov 30 2020 at 14:49)</a>:</h4>
<p>which might be a good starting point if we want to go this way</p>



<a name="218295756"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295756" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295756">(Nov 30 2020 at 14:49)</a>:</h4>
<p>that said <a href="https://github.com/rust-lang/rust/pull/74525/files#r457465014">this comment of mine</a> seems to be wrong</p>



<a name="218295776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295776">(Nov 30 2020 at 14:49)</a>:</h4>
<p>(factually)</p>



<a name="218295857"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295857" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295857">(Nov 30 2020 at 14:50)</a>:</h4>
<p>I'm still of slightly mixed minds about what semantics we <em>want</em>, but the stable semantics for positive impls kind of pushes us in one direction it seems</p>



<a name="218295912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295912">(Nov 30 2020 at 14:50)</a>:</h4>
<p>so I think that the big issue is that if we keep auto impls if negative ones don't apply</p>



<a name="218295981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295981">(Nov 30 2020 at 14:50)</a>:</h4>
<p>(hmm of and if we stabilize <code>!</code>, can we remove reservation impls?)</p>



<a name="218295995"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218295995" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218295995">(Nov 30 2020 at 14:50)</a>:</h4>
<p>we end up with</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="o">!</span><span class="n">Trait</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;'</span><span class="nb">static</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="p">{}</span><span class="w"></span>
</code></pre></div>



<a name="218296059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296059">(Nov 30 2020 at 14:51)</a>:</h4>
<p>yeah this is the "specialization" considerations I was talking about</p>



<a name="218296114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296114">(Nov 30 2020 at 14:51)</a>:</h4>
<p>I guess we got distracted from going too far down that road</p>



<a name="218296171"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296171" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296171">(Nov 30 2020 at 14:52)</a>:</h4>
<p><span class="user-mention" data-user-id="362503">@Yulia Startsev</span> sorry looks like we opened a bit of a pandora's box here :) but we can talk about it next week some more perhaps</p>



<a name="218296263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296263">(Nov 30 2020 at 14:52)</a>:</h4>
<p>ok, that sounds good</p>



<a name="218296269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296269">(Nov 30 2020 at 14:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/144729-wg-traits/topic/negative.20impls/near/218296059">said</a>:</p>
<blockquote>
<p>yeah this is the "specialization" considerations I was talking about</p>
</blockquote>
<p>that said, this is only an issue for auto traits</p>



<a name="218296297"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296297" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296297">(Nov 30 2020 at 14:52)</a>:</h4>
<p>i think for now i am a bit stuck in terms of what i should do next</p>



<a name="218296322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296322">(Nov 30 2020 at 14:52)</a>:</h4>
<p>the answer might be to have some limits on what kinds of impls we permit on auto traits</p>



<a name="218296393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296393">(Nov 30 2020 at 14:53)</a>:</h4>
<p>yeah, I'm not sure the best next step yet</p>



<a name="218296400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296400">(Nov 30 2020 at 14:53)</a>:</h4>
<p>right now i have a working implementation of lcnr's patch, and a partially refactored one to make use of the adt code for slice and array, but the rest stayed more or less the same</p>



<a name="218296418"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296418" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296418">(Nov 30 2020 at 14:53)</a>:</h4>
<p>reading a bit into trait selection is an option</p>



<a name="218296445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296445">(Nov 30 2020 at 14:53)</a>:</h4>
<p>I think there is some coverage in the rustc-dev-guide</p>



<a name="218296474"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296474" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296474">(Nov 30 2020 at 14:53)</a>:</h4>
<p>i can keep working on that, or i can collect "all possible world" for negative impls interacting with things?</p>



<a name="218296669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218296669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218296669">(Nov 30 2020 at 14:54)</a>:</h4>
<p>ill do that reading</p>



<a name="218297369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/negative%20impls/near/218297369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Yulia Startsev <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/negative.20impls.html#218297369">(Nov 30 2020 at 14:59)</a>:</h4>
<p>OK, I need to switch back to my other stuff, I will find time during the week to do that reading then!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>